		.PL	60
		.LINKLIST
		.CHIP		R65c02
		.SYNTAX		2500


;	TEST PROGRAM FOR THE 65c02 CROSS ASSEMBLER.


		.BYTE
		.WORD

DDATA:	.EQUAL	ABH
ADDRESS:	.EQUAL	ABH
;		EXTERN	PAGE0 DDATA
;		EXTERN	ADDRESS



LD:		LD	A,X
		LD	A,Y
		LD	X,A
		LD	Y,A
		LD	X,SP
		LD	SP,X

		LD	A,DDATA
		LD	X,DDATA
		LD	Y,DDATA

		LD	A,(ADDRESS)
		LD	A,(ADDRESS+X)
		LD	A,((ADDRESS+X))
		LD	A,((ADDRESS)+Y)
		LD	A,(ADDRESS)
		LD	A,(ADDRESS+X)
		LD	A,(ADDRESS+Y)
		LD	A,((ADDRESS))

		LD	X,(ADDRESS)
		LD	X,(ADDRESS+Y)
		LD	X,(ADDRESS)
		LD	X,(ADDRESS+Y)

		LD	Y,(ADDRESS)
		LD	Y,(ADDRESS+X)
		LD	Y,(ADDRESS)
		LD	Y,(ADDRESS+X)

		LD	(ADDRESS),A
		LD	(ADDRESS+X),A
		LD	((ADDRESS+X)),A
		LD	((ADDRESS)+Y),A
		LD	(ADDRESS),A
		LD	(ADDRESS+X),A
		LD	(ADDRESS+Y),A
		LD	((ADDRESS)),A

		LD	(ADDRESS),X
;	LD	(ADDRESS+Y),X
		LD	(ADDRESS),X

		LD	(ADDRESS),Y
;	LD	(ADDRESS+X),Y
		LD	(ADDRESS),Y


ADC:		ADC	A,DDATA
		ADC	A,(ADDRESS)
		ADC	A,(ADDRESS+X)
		ADC	A,((ADDRESS+X))
		ADC	A,((ADDRESS)+Y)
		ADC	A,(ADDRESS)
		ADC	A,(ADDRESS+X)
		ADC	A,(ADDRESS+Y)
		ADC	A,((DDATA))


AND:		AND	A,DDATA
		AND	A,(ADDRESS)
		AND	A,(ADDRESS+X)
		AND	A,((ADDRESS+X))
		AND	A,((ADDRESS)+Y)
		AND	A,(ADDRESS)
		AND	A,(ADDRESS+X)
		AND	A,(ADDRESS+Y)
		AND	A,((DDATA))


CP:		CP	A,DDATA
		CP	X,DDATA
		CP	Y,DDATA
		CP	A,(ADDRESS)
		CP	X,(ADDRESS)
		CP	Y,(ADDRESS)
		CP	A,(ADDRESS+X)
		CP	A,((ADDRESS+X))
		CP	A,((ADDRESS)+Y)
		CP	A,(ADDRESS)
		CP	X,(ADDRESS)
		CP	Y,(ADDRESS)
		CP	A,(ADDRESS+X)
		CP	A,(ADDRESS+Y)
		CP	A,((DDATA))


XOR:		XOR	A,DDATA
		XOR	A,(ADDRESS)
		XOR	A,(ADDRESS+X)
		XOR	A,((ADDRESS+X))
		XOR	A,((ADDRESS)+Y)
		XOR	A,(ADDRESS)
		XOR	A,(ADDRESS+X)
		XOR	A,(ADDRESS+Y)
		XOR	A,((DDATA))


OR:		OR	A,DDATA
		OR	A,(ADDRESS)
		OR	A,(ADDRESS+X)
		OR	A,((ADDRESS+X))
		OR	A,((ADDRESS)+Y)
		OR	A,(ADDRESS)
		OR	A,(ADDRESS+X)
		OR	A,(ADDRESS+Y)
		OR	A,((DDATA))


SBC:		SBC	A,DDATA
		SBC	A,(ADDRESS)
		SBC	A,(ADDRESS+X)
		SBC	A,((ADDRESS+X))
		SBC	A,((ADDRESS)+Y)
		SBC	A,(ADDRESS)
		SBC	A,(ADDRESS+X)
		SBC	A,(ADDRESS+Y)
		SBC	A,((DDATA))


INC:		INC	X
		INC	Y
		INC	(ADDRESS)
		INC	(ADDRESS+X)
		INC	(ADDRESS)
		INC	(ADDRESS+X)
		INC	A


DEC:		DEC	X
		DEC	Y
		DEC	(ADDRESS)
		DEC	(ADDRESS+X)
		DEC	(ADDRESS)
		DEC	(ADDRESS+X)
		DEC	A


ROL:		ROL	A
		ROL	(ADDRESS)
		ROL	(ADDRESS+X)
		ROL	(ADDRESS)
		ROL	(ADDRESS+X)

ROR:		ROR	A
		ROR	(ADDRESS)
		ROR	(ADDRESS+X)
		ROR	(ADDRESS)
		ROR	(ADDRESS+X)

ASL:		ASL	A
		ASL	(ADDRESS)
		ASL	(ADDRESS+X)
		ASL	(ADDRESS)
		ASL	(ADDRESS+X)

LSR:		LSR	A
		LSR	(ADDRESS)
		LSR	(ADDRESS+X)
		LSR	(ADDRESS)
		LSR	(ADDRESS+X)


BIT:		BIT	A,(DDATA)
		BIT	A,(ADDRESS)
		BIT	A,12
		BIT	A,(DDATA+X)
		BIT	A,(ADDRESS+X)


JP:		JP	ADDRESS
		JP	(ADDRESS)
		JP	(DDATA+X)

CALL:		CALL	ADDRESS

RET:		RET

POP:		POP	A
		POP	F
		POP	X
		POP	Y

PUSH:		PUSH	A
		PUSH	F
		PUSH	X
		PUSH	Y

CLR:		CLR	(DDATA)
		CLR	(ADDRESS)
		CLR	(DDATA+X)
		CLR	(ADDRESS+X)

TRB:		TRB	A,(DDATA)
		TRB	A,(ADDRESS)

TSB:		TSB	A,(DDATA)
		TSB	A,(ADDRESS)


EI:		EI

DI:		DI

RETI:		RETI

BRK:		BRK

CCF:		CCF

SCF:		SCF

CDF:		CDF

SDF:		SDF

CVF:		CVF

NOP:		NOP

JR:		JR	JR
		JR	12H

		JR	NC,12H
		JR	NC,JR

		JR	C,12H
		JR	C,JR

		JR	Z,12H
		JR	Z,JR

		JR	M,12H
		JR	M,JR

		JR	NZ,12H
		JR	NZ,JR

		JR	P,12H
		JR	P,JR

		JR	NOV,12H
		JR	NOV,JR

		JR	OV,12H
		JR	OV,JR

BBR:		BBR	0,DDATA,BBR
		BBR	7,DDATA,RMB

BBS:		BBS	0,DDATA,BBR
		BBS	7,DDATA,RMB

RMB:		RMB	0,DDATA
		RMB	1,DDATA
		RMB	2,DDATA
		RMB	3,DDATA
		RMB	4,DDATA
		RMB	5,DDATA
		RMB	6,DDATA
		RMB	7,DDATA

SMB:		SMB	0,DDATA
		SMB	7,DDATA

		.SYNTAX		6502
		.PAGE0
		.org $3
cdbuf:		.db <*

		INCLUDE mac.asm

		.END
